package edu.njfu.mystudentapp.service
import edu.njfu.mystudentapp.model.ResultVO
import edu.njfu.mystudentapp.model.Student
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*
import rx.Observable

interface StudentService {
//    @POST("ListStudentServlet2")
//    fun getStudentData(): Call<List<Student>>
//    @POST("loginServlet")
//    fun getUserInfo(@Query("userName") username:String,@Query("password") password :String):Call<ResultVO>
//    @POST("RegisterServlet")
//    fun registerUser(@Query("userName") username:String,@Query("password") password :String):Call<ResultVO>
//
    //老师的网站
    @POST("listStudents")
    fun getStudentDataByName(stuName:String?): Call<List<Student>>
    @POST("listStudents")
    fun getStudentData(): Call<List<Student>>
    @POST("userLogin")
    fun getUserInfo(@Query("username") username:String,@Query("password") password :String):Call<ResultVO>
    @POST("RegisterServlet")
    fun registerUser(@Query("userName") username:String,@Query("password") password :String):Call<ResultVO>
    @GET("/images/students/{url}")
    fun downloadPic(@Path("url") url:String): Observable<ResponseBody>
}